# -*- coding: utf-8 -*-
# Houdini To Arnold
# Copyright (C) 2013 Erkan Ozgur Yilmaz
#
# This file is part of Houdini To Arnold.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
from ArnoldBase import Base


class LightBase(Base):
    """Represents a basic light in arnold
    """
    def __init__(self, **kwargs):
        super(LightBase, self).__init__(**kwargs)


class QuadLight(LightBase):
    """Arnold version of area light
    """

    def to_ass(self):
        """exports light data
        """
        template = """
    quad_light
    {
     name areaLightShape1
     vertices 4 1 POINT 1 1 0 1 -1 0 -1 -1 0 -1 1 0 
     decay_type "quadratic"
     resolution 512
     matrix
      0.70710680787908542 0.0 -0.70710675449400862 0.0
      -0.35355338616955406 0.86602539649920685 -0.35355341286209313 0.0
      0.61237240742794108 0.50000001261839133 0.61237245366077342 0.0
      15.292301177978516 12.486112594604492 15.292303085327148 1.0 
     color 1 1 1
     intensity 1
     exposure 150
     cast_shadows on
     cast_volumetric_shadows on
     shadow_density 1
     shadow_color 0 0 0
     samples 1
     normalize on
     affect_diffuse on
     affect_specular on
     affect_volumetrics on
     diffuse 1
     specular 1
     sss 1
     indirect 1
     max_bounces 999
     volume_samples 2
    }
    
    """
        return template
